<%@ page import="java.util.List" %>
<%@ page import="java.util.Arrays" %><%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2023/4/1
  Time: 16:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <head>
        <title>Request对象</title>
    </head>
<body>
<h2>Request对象的第三组方法</h2>
<h3>6-4.jsp</h3>
<h3>容器操作</h3>
<%
    // 向容器中存放内容
    request.setAttribute("A", "admin");
    request.setAttribute("B", 29.7);
    request.setAttribute("C", new Double[]{9.8, 4.5, 3.7});
    List<String> list = Arrays.asList("aa", "bb", "cc", "dd");
    request.setAttribute("D", list);
    request.setAttribute("B", true); // 会被原来的覆盖掉
    request.setAttribute("E","china");
    // 删除容器的内容
    request.removeAttribute("E");
    // 页面跳转---转发
    request.getRequestDispatcher("6-5.jsp").forward(request,response);
%>
</body>
</html>
